package com.ruoyi.aqsc.mapper;


import com.ruoyi.aqsc.domain.Label;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface LabelMapper {
    /**
     *增加
     */
    @Insert("insert into t_test_label(label_name) values(#{name})")
    int insertLabel(Label label);

    /**
     *修改
     */
    @Update("update t_test_label set label_name=#{name} where label_id=#{id}")
    int updateLabel(Label label);
    /**
     * 单个删除
     */
    @Delete("delete from t_test_label where label_id=#{id}")
    int deleteById(Integer id);
    /**
     * 单个查询
     */
    @Select("select label_id as id,label_name as name from t_test_label where label_id=#{id}")
    Label selectById(Integer id);
    /**
     * 模糊查询
     */
    @Select("select label_id as id,label_name as name from t_test_label where label_name like '%${name}%'")
    List<Label> select(Label label);
}
